import { ProCardProps } from "@ant-design/pro-components";
import { useState } from "react";
import { TabsProps } from 'antd'
export function useProCard(_items: TabsProps['items']): {
    props: ProCardProps,
    setTab: (tab: string) => void,
    setItems: (items: TabsProps['items']) => void
} {
    const [tab, setTab] = useState<string>()
    const [items, setItems] = useState<TabsProps['items']>([
        ..._items
    ])
    const props: ProCardProps = {
        tabs: {
            tabPosition: 'left',
            accessKey: tab,
            items: items,
            onChange: setTab
        },
    }
    return {
        props,
        setTab,
        setItems
    }
}
